package com.prs.crm.action.sale;

import java.util.Collection;
import java.util.List;

import org.apache.struts2.convention.annotation.Action;
import org.courser.struts.BaseAction;
import org.springframework.beans.factory.annotation.Autowired;

import com.prs.crm.domain.sale.InvoiceType;
import com.prs.crm.domain.sale.SalesReceivesRegistBillReality;
import com.prs.crm.domain.sys.Code;
import com.prs.crm.domain.sys.CodeInvoice;
import com.prs.crm.service.sale.InvoiceTypeService;
import com.prs.crm.service.sale.SalesReceivesRegistBillRealityService;
import com.prs.crm.service.sys.CodeInvoiceService;
import com.prs.crm.service.sys.CodeService;

public class SalesReceivesBillRealityAction extends BaseAction {

	private static final long serialVersionUID = 1L;
	
	private String Encode;
	private CodeInvoice codeInvoice;
	private CodeInvoiceService codeInvoiceService;
	private Code code;
	private CodeService codeService;
	private Collection<CodeInvoice> codelist;

	private SalesReceivesRegistBillReality salesReceivesRegistBillReality;
	
	
	private List<InvoiceType> invoiceTypes;
	
	
	private InvoiceTypeService invoiceTypeService;

	@Autowired
	private SalesReceivesRegistBillRealityService salesReceivesRegistBillRealityService;
	@Action("viewSalesReceivesBillReality")
	public String viewSalesReceivesBillReality() {
		salesReceivesRegistBillReality = this
				.getSalesReceivesRegistBillRealityService().get(
						salesReceivesRegistBillReality.getId());

		return "SUCCESS";
	}

	@Action("salesInvoice")
	public String salesInvoice(){
		this.codelist = this.getCodeInvoiceService().getInvoiceCodeType("销售票据单");
		invoiceTypes=this.getInvoiceTypeService().getAllInvoiceType();
		
		return SUCCESS;
	}
	public SalesReceivesRegistBillReality getSalesReceivesRegistBillReality() {
		return salesReceivesRegistBillReality;
	}

	public void setSalesReceivesRegistBillReality(
			SalesReceivesRegistBillReality salesReceivesRegistBillReality) {
		this.salesReceivesRegistBillReality = salesReceivesRegistBillReality;
	}

	public SalesReceivesRegistBillRealityService getSalesReceivesRegistBillRealityService() {
		return salesReceivesRegistBillRealityService;
	}

	public void setSalesReceivesRegistBillRealityService(
			SalesReceivesRegistBillRealityService salesReceivesRegistBillRealityService) {
		this.salesReceivesRegistBillRealityService = salesReceivesRegistBillRealityService;
	}

	public List<InvoiceType> getInvoiceTypes() {
		return invoiceTypes;
	}

	public void setInvoiceTypes(List<InvoiceType> invoiceTypes) {
		this.invoiceTypes = invoiceTypes;
	}

	public InvoiceTypeService getInvoiceTypeService() {
		return invoiceTypeService;
	}

	public void setInvoiceTypeService(InvoiceTypeService invoiceTypeService) {
		this.invoiceTypeService = invoiceTypeService;
	}

	public String getEncode() {
		return Encode;
	}

	public void setEncode(String encode) {
		Encode = encode;
	}

	public CodeInvoice getCodeInvoice() {
		return codeInvoice;
	}

	public void setCodeInvoice(CodeInvoice codeInvoice) {
		this.codeInvoice = codeInvoice;
	}

	public CodeInvoiceService getCodeInvoiceService() {
		return codeInvoiceService;
	}

	public void setCodeInvoiceService(CodeInvoiceService codeInvoiceService) {
		this.codeInvoiceService = codeInvoiceService;
	}

	public Code getCode() {
		return code;
	}

	public void setCode(Code code) {
		this.code = code;
	}

	public CodeService getCodeService() {
		return codeService;
	}

	public void setCodeService(CodeService codeService) {
		this.codeService = codeService;
	}

	public Collection<CodeInvoice> getCodelist() {
		return codelist;
	}

	public void setCodelist(Collection<CodeInvoice> codelist) {
		this.codelist = codelist;
	}

}
